/**
 * 
 */
package au.edu.swin.videoshop.persistence;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author julie
 *
 */
@Entity
@Table(name="STAFF_SESSION")
public class StaffSessionEntity {
	private Long mSessionId;
	private StaffEntity mStaff;
	private Date mLoginTime;
	private Date mLogoutTime;
	
	/**
	 * @return the sessionId
	 */
	@Id
	@GeneratedValue (strategy=GenerationType.AUTO)
	@Column(name="STAFF_SESSION_ID")
	public Long getSessionId() {
		return mSessionId;
	}
	
	/**
	 * @param sessionId the sessionId to set
	 */
	public void setSessionId(Long sessionId) {
		mSessionId = sessionId;
	}
	
	/**
	 * @return the staff
	 */
	@ManyToOne(optional=false, fetch=FetchType.EAGER)
	@JoinColumn(name="STAFF_ID")
	public StaffEntity getStaff() {
		return mStaff;
	}

	/**
	 * @param staff the staff to set
	 */
	public void setStaff(StaffEntity staff) {
		mStaff = staff;
	}

	/**
	 * @return the loginTime
	 */
	@Column(name="LOGIN_TIME")
	@Temporal(value=TemporalType.DATE)
	public Date getLoginTime() {
		return mLoginTime;
	}
	
	/**
	 * @param loginTime the loginTime to set
	 */
	public void setLoginTime(Date loginTime) {
		mLoginTime = loginTime;
	}
	
	/**
	 * @return the logoutTime
	 */
	@Column(name="LOGOUT_TIME")
	@Temporal(value=TemporalType.DATE)
	public Date getLogoutTime() {
		return mLogoutTime;
	}
	
	/**
	 * @param logoutTime the logoutTime to set
	 */
	public void setLogoutTime(Date logoutTime) {
		mLogoutTime = logoutTime;
	}
	
	
}
